package com.offcn.utils;

import org.apache.http.HttpResponse;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: zola
 * @Date: 2021/9/15 - 09 - 15 - 23:22
 * @Description: com.offcn.utils
 * @Version: 1.0
 */
public class SmsUtil {
    public static HttpResponse sendSms(String mobile,String code) throws Exception {
        /*String host = "http://dingxin.market.alicloudapi.com";
        String path = "/dx/sendSms";
        String method = "POST";
        Map<String, String> headers = new HashMap<>();
        headers.put("Authorization","APPCODE afc19972be114712bffe46e9088f1431");
        Map<String, String> querys = new HashMap<>();
        querys.put("mobile",mobile);
        querys.put("param","code:"+code);
        querys.put("tpl_id","TP1711063");*/
        String host = "http://dingxin.market.alicloudapi.com";
        String path = "/dx/sendSms";
        String appcode = "APPCODE f44b9437185349ad89f5504b8e01f393";
        String method = "POST";
        Map<String, String> header = new HashMap<>();
        header.put("Authorization",appcode);
        Map<String, String> querys = new HashMap<>();
        querys.put("mobile",mobile);
        querys.put("param","code:" + code);
        querys.put("tpl_id","TP1711063");
        HttpResponse httpResponse = HttpUtils.doPost(host, path, method, header, querys, "");
        return httpResponse;
    }

}
